import lodash from "lodash";
import {Num2ColumnChar} from "./systemdemo";

let alternative_symbol = {
    1: "一",
    2: "二",
    3: "三",
    4: "四",
    5: "五",
    6: "六",
    7: "七",
    8: "八",
    9: "九",
    汽: "气",
    0: "零",
    零: "〇",
    进: "入",
    一轴加: "一号轴加",
    A: "a",
    B: "b",
    // 高加: "加热器",  // 加热器和高加不能互换，因为很多地方都有加热器这个词，很容易导致排除加热器时出错
    // 低加: "加热器",
    凝泵: "凝结水泵",
    水位: "液位",

};

// 数据采集系统中为绝对压力的测点
let pressure_absolute = [
    "低排",
    "低压缸排汽",
    "小机排汽",
    "七段抽汽",
    "八段抽汽",
    "高压汽源至汽封蒸汽冷却器进汽压力",
    "大气压",
    "环境压力",
    "七号低加",
    "7号低加",
    "8A低加",
    "8B低加",
    "9A低加",
    "9B低加", // "高压缸前后轴封", "中压缸前轴封", "中压缸后轴封","轴封加热器进汽压力", "高压缸前后轴封漏汽母管",
];

// 数据采集系统中为相对压力的测点
let pressure_relative = [
    "主汽门",
    "调节级",
    "高压缸排汽",
    "再热蒸汽",
    "再热汽门",
    "中压缸进汽",
    "中压缸排汽",
    "低压缸进汽",
    "一段抽汽",
    "二段抽汽",
    "三段抽汽",
    "四段抽汽",
    "五段抽汽",
    "六段抽汽",
    "高加进汽",
    "高加",
    "5号低加",
    "6号低加",
    "小机进汽",
    "除氧器进汽",
    "最终给水",
    "给水泵出水",
    "凝泵",
    "再热减温水",
    "高压门杆漏汽",
    "蒸汽冷却器",
    "低温省煤器进水压力",
    "低温省煤器",
    "蒸冷器",
    "低省",
    "凝结水",
    "前置泵",
    "汽泵",
    "循环水",
];

let name_alias = {
    // excel中的测点名和StandardPoint中的测点名的对应关系
    漏汽量: {
        高压门杆漏汽量: "leakage.高压门杆漏汽量",
        高压门杆漏汽焓: "leakage.高压门杆漏汽焓",
        高压门杆一漏流量: "leakage.高压门杆一漏流量",
        高压门杆二漏流量: "leakage.高压门杆二漏流量",
        高压门杆三漏流量: "leakage.高压门杆三漏流量",
        高压门杆四漏流量: "leakage.高压门杆四漏流量",
        高压前轴封漏汽量: "leakage.高压前轴封漏汽量",
        高压前轴封漏汽焓: "leakage.高压前轴封漏汽焓",
        高压前轴封一漏流量: "leakage.高压前轴封一漏流量",
        高压前轴封二漏流量: "leakage.高压前轴封二漏流量",
        高压前轴封三漏流量: "leakage.高压前轴封三漏流量",
        高压前轴封四漏流量: "leakage.高压前轴封四漏流量",
        高压后轴封漏汽量: "leakage.高压后轴封漏汽量",
        高压后轴封漏汽焓: "leakage.高压后轴封漏汽焓",
        高压后轴封一漏流量: "leakage.高压后轴封一漏流量",
        高压后轴封二漏流量: "leakage.高压后轴封二漏流量",
        高压后轴封三漏流量: "leakage.高压后轴封三漏流量",
        高压后轴封四漏流量: "leakage.高压后轴封四漏流量",
        中压前轴封漏汽量: "leakage.中压前轴封漏汽量",
        中压前轴封漏汽焓: "leakage.中压前轴封漏汽焓",
        中压前轴封一漏流量: "leakage.中压前轴封一漏流量",
        中压前轴封二漏流量: "leakage.中压前轴封二漏流量",
        中压前轴封三漏流量: "leakage.中压前轴封三漏流量",
        中压前轴封四漏流量: "leakage.中压前轴封四漏流量",
        中压后轴封漏汽量: "leakage.中压后轴封漏汽量",
        中压后轴封漏汽焓: "leakage.中压后轴封漏汽焓",
        中压后轴封一漏流量: "leakage.中压后轴封一漏流量",
        中压后轴封二漏流量: "leakage.中压后轴封二漏流量",
        中压后轴封三漏流量: "leakage.中压后轴封三漏流量",
        中压后轴封四漏流量: "leakage.中压后轴封四漏流量",
        低压前轴封漏汽量: "leakage.低压前轴封漏汽量",
        低压前轴封漏汽焓: "leakage.低压前轴封漏汽焓",
        低压前轴封一漏流量: "leakage.低压前轴封一漏流量",
        低压前轴封二漏流量: "leakage.低压前轴封二漏流量",
        低压前轴封三漏流量: "leakage.低压前轴封三漏流量",
        低压前轴封四漏流量: "leakage.低压前轴封四漏流量",
        低压后轴封漏汽量: "leakage.低压后轴封漏汽量",
        低压后轴封漏汽焓: "leakage.低压后轴封漏汽焓",
        低压后轴封一漏流量: "leakage.低压后轴封一漏流量",
        低压后轴封二漏流量: "leakage.低压后轴封二漏流量",
        低压后轴封三漏流量: "leakage.低压后轴封三漏流量",
        低压后轴封四漏流量: "leakage.低压后轴封四漏流量",
    }
}

var StandardPoint = {
    // 该变量主要记录了汽轮机性能计算所需要的所有参数在excel表格中的位置信息，附带也记录了相关参数的数值。
    // 当调用systemdemo.js中的refreshTestPoints()方法后，该变量的信息会自动更新。
    datetime: {
        name: "日期时间",
        include: ["时间", "日期"],
        exclude: ["手抄", "1", "2"],
        href: {
            start: [], // "数据整理!{Y}2",
            end: [],
        },
        value: {
            start: [], // "2021-12-12 12:00",
            end: [], //"2021-12-12 13:30",
        },
    },
    main_steam: {
        name: "主蒸汽", // 联合循环机组中的高压蒸汽
        include: ["主蒸汽", "主汽门前", "主汽", "高压缸进汽", "高压蒸汽"],
        exclude: ["中压", "低压", "小机"],
        watch: {  // 监视该测点中某参数的引用位置
            F: []  // 例如["汽机!{Y}23"]，表示汽机工作表中第23行引用了主汽流量，当主汽流量有值时，需要更新"汽机!{Y}23"
        },
        href: {
            P: [], // 压力索引，例如["数据整理!{Y}4"]，这里的{Y}表示列索引未定
            T: [],
            H: [],
            S: [],
            F: [], // 流量索引
            dP: [], // 差压索引
            power: [], // 功率索引
            U: [], // 电压索引
            I: [], // 电流索引
        },
        value: {
            P: 0, // 压力值
            T: 0,
            H: 0,
            S: 0,
        },
    },
    mid_main_steam: {  // 联合循环机组中有高压主汽、中压主汽、低压主汽等不同位置的测点
        name: "中压主蒸汽",
        include: ["中压主汽", "中压蒸汽", "中压主蒸汽", "中压过热器出口"],
        exclude: ["高压", "低压", "小机", "中压缸进汽", "中压主汽门前"], // 中压缸进汽不是中压主汽，中压主汽和高排混合后，经再热器后成为中压缸进汽
        watch: {  // 监视该测点中某参数的引用位置
            F: []  // 例如["汽机!{Y}23"]，表示汽机工作表中第23行引用了主汽流量，当主汽流量有值时，需要更新"汽机!{Y}23"
        },
        href: {
            P: [], // 压力索引，例如["数据整理!{Y}4"]，这里的{Y}表示列索引未定
            T: [],
            H: [],
            S: [],
            F: [], // 流量索引
            dP: [], // 差压索引
            power: [], // 功率索引
            U: [], // 电压索引
            I: [], // 电流索引
        },
        value: {
            P: 0, // 压力值
            T: 0,
            H: 0,
            S: 0,
        },
    },
    low_main_steam: {  // 联合循环机组中有高压主汽、中压主汽、低压主汽等不同位置的测点
        name: "低压主蒸汽",
        include: ["低压主汽", "低压蒸汽", "低压主蒸汽", "低压过热器出口"], // 低压主汽门前流量就是低压主蒸汽流量
        exclude: ["高压", "中压", "小机", "低压缸进汽"],  // 低压缸进汽不是低压主汽，低压主汽和中排混合后成为低压缸进汽
        watch: {  // 监视该测点中某参数的引用位置
            F: []  // 例如["汽机!{Y}23"]，表示汽机工作表中第23行引用了主汽流量，当主汽流量有值时，需要更新"汽机!{Y}23"
        },
        href: {
            P: [], // 压力索引，例如["数据整理!{Y}4"]，这里的{Y}表示列索引未定
            T: [],
            H: [],
            S: [],
            F: [], // 流量索引
            dP: [], // 差压索引
            power: [], // 功率索引
            U: [], // 电压索引
            I: [], // 电流索引
        },
        value: {
            P: 0, // 压力值
            T: 0,
            H: 0,
            S: 0,
        },
    },
    adjust_steam: {
        name: "调节级",
        include: ["调节级"],
        exclude: [],
        exists: false, // 默认不存在调节级
    },
    outlet_high: {
        name: "高压缸排汽",
        include: ["高压缸排汽", "高排", "冷再热蒸"],
        exclude: [],
    },
    cold_reheat_steam: {
        name: "冷再热蒸汽",
        include: ["冷再热", "冷再",],
        exclude: [],
        href: {P: null, T: null, F: null},
        value: {P: null}
    },
    inlet_medium: { // 再热蒸汽和中压主汽不是一个测点，中压主汽和高排混合后进入再热器加热后，成为热再蒸汽
        name: "再热蒸汽",
        include: ["再热汽门前", "热再", "再热", "中压缸进汽", "中压主汽门前"],
        exclude: ["冷再", "再热减温水", "再减"],
    },
    hot_reheat_steam: {
        name: "该测点等同于测点：inlet_medium"
    },
    outlet_medium: {
        name: "中压缸排汽",
        include: ["中排", "中压缸排汽"],
        exclude: [],
    },
    inlet_low: {
        name: "低压缸进汽",  // 低压缸进汽和低压蒸汽不是一个测点，低压蒸汽和中排混合后成为低压缸进汽，低压主汽门前指的是低压主蒸汽流量
        include: ["低压缸进汽"],
        exclude: ["低压蒸汽", "低压主汽门前"]
    },
    outlet_low: {
        name: "低压缸排汽",
        include: ["低压缸排汽", "背压"],
        exclude: ["小机"],
        href: {
            H_等熵: [],
            F_V: [], // 体积流量
            sv: [], // 比容
            velocity: [], // 流速
        }
    },
    pump_turbine_vapor_out: {
        name: "小机排汽",
        include: ["小机排汽"],
        exclude: []
    },
    extract_0: {
        name: "零段抽汽",
        include: ["零段抽汽", "零抽"],
        exclude: ["至"],
        href: {
            P: [],
            T: [],
            压损: [],
        },
    },
    extract_1: {
        name: "一段抽汽",
        include: ["一段抽汽", "一抽"],
        exclude: ["至"],
        href: {
            P: [],
            T: [],
            E: [], // 能量
            压损: [],
        },
    },
    heater_1: {  // 与抽汽级数对应的加热器名称，软件内部使用
        name: "一号高加",  // 加热器外部显示的名称
        drain_to: null, // 疏水去向，"heater_2"
        href: {
            上端差: [],
            下端差: [],
            温升: [],
            F: [], // 流经一号高加的给水流量
        },
    },
    heater_2: {  // 与抽汽级数对应的加热器名称，软件内部使用
        name: "二号高加",
        drain_to: null, // 疏水去向，"heater_3"
        href: {
            上端差: [],
            下端差: [],
            温升: [],
        },
    },
    heater_3: {
        name: "三号高加",
        drain_to: null, // 疏水去向，"deaerator_drain_water_in"
        href: {
            上端差: [],
            下端差: [],
            温升: [],
            Q: [], // 高加水侧吸热量
        },
    },
    heater_pre_3: {
        name: "三号高加",
        href: {
            上端差: [],
            下端差: [],
            温升: [],
            Q: [], // 高加水侧吸热量
        },
    },
    heater_4: {
        name: "四号高加",
        href: {
            上端差: [],
            下端差: [],
            温升: [],
        },
    },
    heater_5: {
        name: "五号低加",
        drain_to: null, // 疏水去向，"heater_6"
        href: {
            上端差: [],
            下端差: [],
            温升: [],
        },
    },
    heater_6: {
        name: "六号低加",
        drain_to: null, // 疏水去向，"heater_7"
        href: {
            上端差: [],
            下端差: [],
            温升: [],
        },
    },
    heater_7: {
        name: "七号低加",
        drain_to: null, // 疏水去向，heater_6_water_in，打入六号低加入口
        href: {
            上端差: [],
            下端差: [],
            温升: [],
        },
    },
    heater_8: {
        name: "八号低加",
        drain_to: null, // 疏水去向，"heater_9"
        href: {
            上端差: [],
            下端差: [],
            温升: [],
        },
    },
    heater_9: {
        name: "九号低加",
        drain_to: null, // 疏水去向，"condenser"
        href: {
            上端差: [],
            下端差: [],
            温升: [],
        },
    },
    heater: {
        name: "加热器",
        value: {
            高加级数: null,
            低加起始级数: null,
            低加结束级数: null,
        }
    },
    heater_1_vapor_in: {
        name: "一号高加进汽",
        include: ["一号高加进汽", "一进", "一高加进汽", "#1高加进汽"],
        exclude: [],
    },
    heater_1_vapor_out: {
        name: "一号高加疏水",
        include: ["一号高加疏水", "一高加疏水", "#1高加疏水"],
        exclude: [],
        exists: false,  // 测点是否存在，默认不存在，get_高加级数()方法会根据各个高加的疏水测点是否存在来确定高加是否存在
    },
    heater_1_water_in: {
        name: "一号高加进水",
        include: ["一号高加进水", "一高加进水", "#1高加进水"],
        exclude: [],
    },
    heater_1_water_out: {
        name: "一号高加出水",
        include: ["一号高加出水", "一高加出水", "#1高加出水"],
        exclude: [],
        link: null, // link指定了该点的替代点，如"1号高加出水"通常就是"2号高加进水"
        href: {
            // href指定了该点在excel表格中的引用位置
            P: [],
        },
    },
    extract_2: {name: "二段抽汽", include: ["二段抽汽", "二抽"], exclude: ["至"]},
    heater_2_vapor_in: {
        name: "二号高加进汽",
        include: ["二号高加进汽", "二高加进汽", "#2高加进汽"],
        exclude: [],
    },
    heater_2_vapor_out: {
        name: "二号高加疏水",
        include: ["二号高加疏水", "二高加疏水", "#2高加疏水"],
        exclude: [],
    },
    heater_2_water_in: {
        name: "二号高加进水",
        include: ["二号高加进水", "二高加进水", "#2高加进水"],
        exclude: [],
    },
    heater_2_water_out: {
        name: "二号高加出水",
        include: ["二号高加出水", "二高加出水", "#2高加出水"],
        exclude: [],
    },
    extract_3: {name: "三段抽汽", include: ["三段抽汽", "三抽"], exclude: ["至"]},
    heater_pre_3_vapor_in: {
        name: "蒸冷器进汽",
        include: ["蒸冷器进汽"],
        exclude: [],
    },
    heater_pre_3_vapor_out: {
        name: "蒸冷器进汽",
        include: ["蒸冷器进汽"],
        exclude: [],
    },
    heater_pre_3_water_in: {
        name: "蒸冷器进水",
        include: ["蒸冷器进水"],
        exclude: [],
    },
    heater_pre_3_water_out: {
        name: "蒸冷器出水",
        include: ["蒸冷器出水"],
        exclude: [],
    },
    heater_3_vapor_in: {
        name: "三号高加进汽",
        include: ["三号高加进汽", "三高加进汽", "#3高加进汽"],
        exclude: [],
    },
    heater_3_vapor_out: {
        name: "三号高加疏水",
        include: ["三号高加疏水", "三高加疏水", "#3高加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_3_water_in: {
        name: "三号高加进水",
        include: ["三号高加进水", "三高加进水", "#3高加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_3_water_out: {
        name: "三号高加出水",
        include: ["三号高加出水", "三高加出水", "#3高加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    extract_4: {
        name: "四段抽汽", include: ["四段抽汽", "四抽"], exclude: ["至"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_4_vapor_in: {
        name: "四号高加进汽",
        include: ["四号高加进汽", "四高加进汽", "#4高加进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_4_vapor_out: {
        name: "四号高加疏水",
        include: ["四号高加疏水", "四高加疏水", "#4高加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_4_water_in: {
        name: "四号高加进水",
        include: ["四号高加进水", "四高加进水", "#4高加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_4_water_out: {
        name: "四号高加出水",
        include: ["四号高加出水", "四高加出水", "#4高加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    extract_5: {
        name: "五段抽汽", include: ["五段抽汽", "五抽"],
        exclude: ["至"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_5_vapor_in: {
        name: "五号低加进汽",
        include: ["五号低加进汽", "五低加进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_5_vapor_out: {
        name: "五号低加疏水",
        include: ["五号低加疏水", "五低加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_5_water_in: {
        name: "五号低加进水",
        include: ["五号低加进水", "五低加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_5_water_out: {
        name: "五号低加出水",
        include: ["五号低加出水", "五低加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    extract_6: {
        name: "六段抽汽", include: ["六段抽汽", "六抽"],
        exclude: ["至"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_6_vapor_in: {
        name: "六号低加进汽",
        include: ["六号低加进汽", "六低加进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_6_vapor_out: {
        name: "六号低加疏水",
        include: ["六号低加疏水", "六低加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_6_water_in: {
        name: "六号低加进水",
        include: ["六号低加进水", "六低加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_6_water_out: {
        name: "六号低加出水",
        include: ["六号低加出水", "六低加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    extract_7: {
        name: "七段抽汽", include: ["七段抽汽", "七抽汽"],
        exclude: ["至"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_7_vapor_in: {
        name: "七号低加进汽",
        include: ["七号低加进汽", "七低加进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_7_vapor_out: {
        name: "七号低加疏水",
        include: ["七号低加疏水", "七低加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_7_water_in: {
        name: "七号低加进水",
        include: ["七号低加进水", "七低加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_7_water_out: {
        name: "七号低加出水",
        include: ["七号低加出水", "七低加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    extract_8: {
        name: "八段抽汽", include: ["八段抽汽", "八抽"],
        exclude: ["至"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    extract_9: {
        name: "九段抽汽", include: ["九段抽汽", "九抽"],
        exclude: ["至"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8_vapor_in: {
        name: "八号低加进汽",
        include: ["八号低加进汽", "八低加进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8A_vapor_in: {
        name: "八A加热器进汽",
        include: ["八A加热器进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8B_vapor_in: {
        name: "八B加热器进汽",
        include: ["八B加热器进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8_vapor_out: {
        name: "八号低加疏水",
        include: ["八号低加疏水", "八低加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8A_vapor_out: {
        name: "八A号低加疏水",
        include: ["八A号低加疏水", "八A低加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8B_vapor_out: {
        name: "八B号低加疏水",
        include: ["八B号低加疏水", "八B低加疏水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8_water_in: {
        name: "八号低加进水",
        include: ["八号低加进水", "八低加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8A_water_in: {
        name: "八A号低加进水",
        include: ["八A号低加进水", "八A低加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8B_water_in: {
        name: "八B号低加进水",
        include: ["八B号低加进水", "八B低加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8_water_out: {
        name: "八号低加出水",
        include: ["八号低加出水", "八低加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8A_water_out: {
        name: "八A号低加出水",
        include: ["八A号低加出水", "八A低加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_8B_water_out: {
        name: "八B号低加出水",
        include: ["八B号低加出水", "八B低加出水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    heater_9_vapor_in: {
        name: "九号低加进汽",
        include: ["九低加进汽", "九号低加进汽"],
        exclude: [],
    },
    heater_9A_vapor_in: {
        name: "九A加热器进汽",
        include: ["九A低加进汽", "九A号低加进汽"],
        exclude: [],
    },
    heater_9B_vapor_in: {
        name: "九B低加进汽",
        include: ["九B低加进汽", "九A号低加进汽"],
        exclude: [],
    },
    heater_9_vapor_out: {
        name: "九号低加疏水",
        include: ["九低加疏水", "九号低加疏水"],
        exclude: [],
    },
    heater_9A_vapor_out: {
        name: "九A低加疏水",
        include: ["九A低加疏水", "九A号低加疏水"],
        exclude: [],
    },
    heater_9B_vapor_out: {
        name: "九B低加疏水",
        include: ["九B低加疏水", "九B号低加疏水"],
        exclude: [],
    },
    heater_9_water_in: {
        name: "九号低加进水",
        include: ["九低加进水", "九号低加进水"],
        exclude: [],
    },
    heater_9A_water_in: {
        name: "九A低加进水",
        include: ["九A低加进水", "九A号低加进水"],
        exclude: [],
    },
    heater_9B_water_in: {
        name: "九B低加进水",
        include: ["九B低加进水", "九B号低加进水"],
        exclude: [],
    },
    heater_9_water_out: {
        name: "九号低加出水",
        include: ["九低加出水", "九号低加出水"],
        exclude: [],
    },
    heater_9A_water_out: {
        name: "九A低加出水",
        include: ["九A低加出水", "九A号低加出水"],
        exclude: [],
    },
    heater_9B_water_out: {
        name: "九B低加出水",
        include: ["九B低加出水", "九B号低加出水"],
        exclude: [],
    },
    seal_heater_1_water_in: {
        name: "一号轴加进水",
        include: ["一号轴加进水", "轴加进水"],
        exclude: [],
    },
    seal_heater_2_water_in: {
        name: "二号轴加进水",
        include: ["二号轴加进水", "二轴加进水"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    seal_heater_vapor_in: {
        name: "汽封加热器进汽",
        include: ["汽封加热器进汽", "轴封加热器进汽", "轴加进汽",],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    seal_heater_water_in: {
        name: "汽封加热器进水",
        include: ["汽封加热器进", "轴封加热器进", "轴加进", "凝结水加热器进"],
        exclude: ["进汽"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    seal_heater_water_out: {
        name: "汽封加热器出水",
        include: ["汽封加热器出水", "轴封加热器出水", "轴加出水", "轴加后", "凝结水加热器出"],
        exclude: ["出汽"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    }, // # ------------------------------
    //     热井至加热器之间测点
    // ----------------------------
    heat_well_out: {
        name: "热井出水",
        include: ["热井出"],
        exclude: []
    },
    water_condense_pump_in: {
        name: "凝泵进口",
        include: ["凝泵进", "凝结水泵进"],
        exclude: [],
    },
    water_condense_pump_A_in: {
        name: "凝泵A进",
        include: ["凝泵A进"],
        exclude: [],
    },
    water_condense_pump_B_in: {
        name: "凝泵B进",
        include: ["凝泵B进"],
        exclude: [],
    },

    water_condense_pump_out: {
        name: "凝泵出水",
        include: ["凝泵出", "凝结水泵出", "凝结水温度", "凝结水压力", "余热锅炉凝结水"],
        exclude: ["除氧器", "轴加出", "FGH", "低压汽包入口"],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },

    pump_condense_water_out: {
        name: "该测点别名为：water_condense_pump_out"
    },

    water_condense_pump_A_out: {
        name: "凝泵A出水",
        include: ["凝泵A出"],
        exclude: [],
    },
    water_condense_pump_B_out: {
        name: "凝泵B出水",
        include: ["凝泵B出"],
        exclude: [],
    },


    hrsg_low_water_in: {
        name: "余热锅炉入口低压给水",
        include: ["凝结水预热器入口", "余热锅炉入口", "低压省煤器入口"],
        exclude: ["烟气"],

    },


    eco_low_water_out: {
        name: "余热锅炉低压省煤器出口",
        include: ["低压省煤器出口", "凝结水预热器出口"],
        link: ["hrsg_low_water_out"],  // 当低压省煤器出口参数没有时，查找
    },


    // # ------------------------------
    //     低加出口至高加进口之间测点
    // ----------------------------
    main_condense_water: { // 该测点为进凝泵出口管道测点
        name: "主凝结水",
        include: [
            "主凝结水",
            "余热锅炉进口凝结水",
        ],
        exclude: ["凝结水流量"],// 凝结水流量一般指的是除氧器进水流量，但凝结水的其他参数指的一般是凝泵出口参数
    },
    deaerator_vapor_in: {
        name: "除氧器进汽",
        include: ["除氧器进汽"],
        exclude: [],
    },
    deaerator_drain_water_in: {
        name: "进除氧器疏水",
        include: ["进除氧器疏水"],
        exclude: [],
    },
    deaerator_water_in: {
        name: "除氧器进水",
        include: [
            "除氧器进水",
            "进除氧器凝结水",
            "除氧器进口凝结水",],
        exclude: [],
    },
    deaerator_water_out: {
        name: "除氧器出水",
        include: ["除氧器出水", "除氧器下水"],
        exclude: [],
    },
    deaerator_water_lvl: {
        name: "除氧器水位",
        include: ["除氧器水位", "除氧器液位"],
        exclude: [],
        href: {start: [], end: [], as_F: []}, // 开始水位，结束水位，当量流量
    },
    pump_turbine_vapor_in: {
        name: "小机进汽",
        include: ["小机进汽", "给水泵汽轮机进汽"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    pump_before_water_in: {
        name: "前置泵进水",
        include: ["前置泵进"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    pump_before_water_out: {
        name: "前置泵出水",
        include: ["前置泵出"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    feed_pump_in: {
        name: "给水泵进水",
        include: ["给水泵进", "汽泵进"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    feed_pump_out: {
        name: "给水泵出水",
        include: ["给水泵出", "汽泵出"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    final_feed_water: {
        name: "最终给水", include: ["最终给水"], exclude: [],
        href: {
            P: null,
            T: null,
            F: null,
            F_计算值: null,
        },
        value: {P: null, T: null,}
    },
    feed_water_low: {
        name: "低压给水", // 燃机测点
        include: ["低压给水", "低压汽包进", "低压汽包入口"],
        exclude: []
    },

    feed_water_mid: {  // 中压给水流量（运行值）
        name: "中压给水",
        include: ["中压给水"],
        exclude: ["燃料", "FGH"],
    },

    feed_water_high: {
        name: "高压给水",
        include: ["高压给水"],

    },

    drum_low_water_in: {
        name: "低压汽包入口",
        include: ["低压汽包入口"],
        exclude: [],
        link: ["eco_low_water_out"], // 低压汽包入口给水可以取低压省煤器出水
    },


    drum_low: {
        name: "低压汽包",
        include: ["低压汽包"]
    },

    drum_mid: {
        name: "中压汽包",
        include: ["中压汽包"]
    },

    drum_high: {
        name: "高压汽包",
        include: ["高压汽包"]
    },

    water_reheater_reducing: {
        name: "再热减温水",
        include: ["再减", ["再热", "减温水"], ["中压", "减温水"]],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },
    // water_overheat_reducing_1: { include: ["过热一级减温水"], exclude: [] },
    // water_overheat_reducing_2: { include: ["过热二级减温水"], exclude: [] },
    water_overheat_reducing: {
        name: "过热减温水",
        include: ["过热减温水", "过热器减温水", "过减"],
        exclude: [],
        href: {P: null, T: null,},
        value: {P: null, T: null,}
    },

    p_env: {
        name: "大气压力",
        include: ["大气压力"],
        exclude: []
    },
    env: {
        name: "环境",
        include: ["大气压力", "环境温度", "干球温度", "相对湿度", ["空气", "湿度"], ["大气", "湿度"], ["环境", "湿度"], "大气温度"], // 相对湿度和湿度有两种写法
        exclude: ["出口", "变化"],  // 排除类似 环境温度变化量 这类参数

    },

    condenser_water_lvl: {
        name: "凝汽器水位",
        include: ["凝汽器水位", "凝汽器液位", "排汽装置液位", "排汽装置水位"],
        exclude: [],
        href: {start: [], end: [], as_F: []}, // 开始水位，结束水位，当量流量
    },
    condenser: {
        name: "凝汽器",
        include: [],
        href: {},

    },
    economizer_water_outlet: {
        name: "低温省煤器出水",
        include: ["省煤器出", "省煤器回", "低省出", "低省回"],
        exclude: [],
        link: ["hrsg_low_water_out"], // 联合循环中，余热锅炉低压省煤器出口就是低压省煤器出口
    },
    economizer_water_inlet: {
        name: "低温省煤器进水",
        include: ["省煤器进水", "低省进口"],
        exclude: [],
        link: ["hrsg_low_water_in"], // 联合循环中，余热锅炉低压省煤器进口就是低温省煤器进口
    },


    bypass_high_water: {
        name: "高加旁路给水",
        include: ["高加旁路给水"],
        href: {
            F: [], // 高加旁路给水流量，默认为0
        },
    },

    condenser_recycled_water_in: {
        name: "凝汽器循环水进水",
        include: [["循环水", "入"], ["循环水", "进"]], // 元素为列表表示元素的所有子元素必须都包含才匹配
        exclude: ["A", "a", "B", "b", "塔"],  // 排除时，多个同义词都要排除
    },
    condenser_A_recycled_water_in: {
        name: "凝汽器A侧循环水进水",
        include: [["循环水", "A", "入"], ["循环水", "A", "进"]],
        exclude: ["B", "b", "塔"],
    },
    condenser_B_recycled_water_in: {
        name: "凝汽器B侧循环水进水",
        include: [["循环水", "B", "入"], ["循环水", "B", "进"]],
        exclude: ["A", "a", "塔"],
    },
    condenser_recycled_water_out: {
        name: "凝汽器循环水出水",
        include: [["循环水", "出"], ["循环水", "回"]],
        exclude: ["A", "a", "B", "b", "塔"],
    },
    condenser_A_recycled_water_out: {
        name: "凝汽器A侧循环水出水",
        include: [["循环水", "A", "出"], ["循环水", "A", "回"]],
        exclude: ["B", "b", "塔"],
    },
    condenser_B_recycled_water_out: {
        name: "凝汽器B侧循环水出水",
        include: [["循环水", "B", "出"], ["循环水", "B", "回"]],
        exclude: ["A", "a", "塔"],
    },
    gas_turbine_in: {
        name: "燃气轮机进口空气",
        include: ["压气机入口", "燃机入口空气", "入口空气", "压气机进口", ["空气滤网", "温度"]],
        exclude: ["冷却塔"],
        href: {T: null,},
        value: {T: null,},
    },

    gas_turbine_out: {
        name: "燃机排气",
        include: ["燃机排气", "余热锅炉入口烟气", "余热锅炉进口烟气"],
        exclude: [],
        href: {T: null,},
        value: {T: null,},
    },

    regulator_station: {
        name: "调压站天然气",
        include: ["调压站"],
        exclude: [],
    },

    fgh_gas_in: {
        name: "FGH进口天然气",
        include: ["FGH入口天然气", "前置模块天然气", "前置模块燃料气", "前置模块进口燃料气"],
        exclude: [],
    },

    fgh_gas_out: {
        name: "FGH出口天然气",
        include: ["FGH出口天然气", "性能加热器出口燃料气", "FGH出口燃气", "性能加热器出口天然气", "燃料加热器出口天然气", "燃料加热器出口燃料气"],
        exclude: [],
    },

    fgh_water_in: {
        name: "FGH进水",
        include: ["FGH入口凝结水", "燃料加热器进水", "FGH进水", "性能加热器进水"],
        exclude: [],
    },

    fgh_water_out: {
        name: "FGH回水",
        include: ["FGH出口凝结水", "燃料加热器回水", "FGH回水", "性能加热器回水"],
        exclude: [],
    },

    group: {
        name: "机组",
        include: [],
        exclude: [],
        href: {
            hr: [],
            hr_correct1: [],
            hr_correct2: [],
            net_power: [], // 机组净功率
            shaft_power: [], // 机组轴功率=发电机功率/发电机效率
        },
    },
    generator_gas_turbine: { // 对于多轴联合循环机组有多个发电机，需要分开处理
        name: "燃机发电机",
        include: ["燃机发电机"],// 用户的测点名为"功率"时，一般指的都是发电机输出功率
        exclude: ["励磁"],
        href: {
            power: [],
            eta: [], // 发电机效率
            factor: [], // 功率因数
            freq: [], // 发电机频率
            p_h2: [], // 氢压
        },
    },
    generator_turbine: {
        name: "汽轮机发电机",
        include: ["汽机发电机", "汽轮发电机", "汽轮机发电机"],// 用户的测点名为"功率"时，一般指的都是发电机输出功率
        exclude: ["励磁"],
        href: {
            power: [],
            eta: [], // 发电机效率
            factor: [], // 功率因数
            freq: [], // 发电机频率
            p_h2: [], // 氢压
        },
    },
    generator: {
        name: "发电机",
        include: ["功率", "发电机", "总负荷"],// 用户的测点名为"功率"时，一般指的都是发电机输出功率
        exclude: ["励磁", "燃机", "燃气轮机"],
        href: {
            power: [],
            eta: [], // 发电机效率
            factor: [], // 功率因数
            freq: [], // 发电机频率
            p_h2: [], // 氢压
        },
    },
    excitation: {
        name: "励磁",
        include: ["励磁"],
        href: {
            U: [],
            I: [],
            power: [],
        }
    },
    turbine_high: {
        name: "高压缸",
        include: ["高压缸效率"],
        exclude: [],
        href: {
            eta: [],
            主汽至一抽段流量: [],
            一抽至高排段流量: [],
            shaft_power: [],
        },
    },
    turbine_medium: {
        name: "中压缸",
        include: ["中压缸效率"],
        exclude: [],
        href: {
            eta: [],
            四抽至中排段流量: [],
            四抽至中排段功率: [],
            shaft_power: [],
        },
    },
    turbine_low: {
        name: "低压缸",
        include: ["低压缸效率", "低压缸末级叶片环形面积", "排汽面积"],
        exclude: [],
        href: {
            eta: [],
            eta_计算值: [],
            eta1: [],
            shaft_power: [],
            area: [], // 排汽面积
            loss_排汽: [], // 排汽损失
        },
    },

    reheater: {
        name: "再热器",
        include: ["再热器"],
        exclude: ["压力", "温度", "流量"],
        href: {
            压损: []
        }
    },

    hrsg_flue_out: {
        name: "余热锅炉排烟",
        include: ["余热锅炉排烟", "余热锅炉排气"],

    },


    leakage: {
        name: "漏汽信息", include: ["漏汽"], exclude: [],
        href: {
            高压端漏汽总量: [],
            高压门杆漏汽量: [],
            高压门杆一漏流量: [],
            高压门杆二漏流量: [],
            高压前轴封漏汽量: [],
            高压前轴封一漏流量: [],
            高压后轴封漏汽量: [],
            中压前轴封漏汽量: [],
            中压前轴封漏汽焓: [],
            中压后轴封漏汽量: [],
        },
        value: {},
        obj: null,  // 字典中的对象值不能是new Leakage()，否则会报错，且错误非常难以察觉
    },
    leakage_known: {
        name: "明漏量",
        include: ["明漏量"],
        exclude: ["不明"],
        href: {F: []},
    },
    leakage_unknown: {
        name: "不明漏量",
        include: ["不明漏量"],
        exclude: [""],
        href: {
            F: [],
            percentage_boiler: [],
            percentage_turbine: [],
            rate: [], // 不明漏率
        },
    },

    design_para: {
        name: "设计参数",
        href: {
            T0: [], // 设计环境温度
            P0: [], // 设计大气压力
            humid0: [], // 设计环境湿度
        }
    },

    curve_correct: {
        name: "修正曲线",
        href: {
            f_T0_power: null, // 环境温度对功率的修正曲线
            f_P0_power: null, // 大气压力对功率的修正曲线
            f_humid0_power: null, // 环境湿度对功率的修正曲线
            f_T0_hr: null, // 环境温度对热耗率的修正曲线
            f_P0_hr: null, // 大气压力对热耗率的修正曲线
            f_humid0_hr: null, // 环境湿度对热耗率的修正曲线
        }
    },

    correct_factor: {
        name: "修正系数",
        href: {
            delta_T0: [], // 试验环境温度和设计环境温度差值
            delta_P0: [],
            delta_humid0: [],
            f_T0_power: [], // 环境温度对功率的修正系数
            f_P0_power: [], // 大气压力对功率的修正系数
            f_humid0_power: [], // 环境湿度对功率的修正系数
            f_T0_hr: [], // 环境温度对热耗率的修正系数
            f_P0_hr: [], // 大气压力对热耗率的修正系数
            f_humid0_hr: [], // 环境湿度对热耗率的修正系数
        },

    },

    insert_para_link(para_string, pos) {
        /**
         * 在测点引用列表的第一个元素之前插入新的引用位置，因为获取测点引用时，默认获取第一个，这样可以使得后续的测点引用一直使用第一个
         * @type {string[]}
         */
        let pp = lodash.split(para_string, ".", 2);
        let point_name = pp[0];
        let para = pp[1];
        let point = this[point_name];
        if (point) {
            if (!lodash.isArray(point["href"][para])) {
                point["href"][para] = []
            }
            if (!lodash.includes(point["href"][para], pos)) {
                point["href"][para].unshift(pos) // 数组头部插入元素
            }
        }
    },
    delete_para(para_string) {
        /**
         * 删除测点的某个值的引用，如果变量中的测点名不属于StandardPoint，则不进行任何操作
         */
        let pp = lodash.split(para_string, ".", 2);
        let point_name = pp[0];
        let para = pp[1];
        let point = this[point_name];
        if (point) {
            if (point["href"]) {
                point["href"][para] = null;
            }
        }
    },
    set_para_link(para_string, link) {
        /**
         * 设置某个变量的引用，如果变量中的测点名不属于StandardPoint，则不进行任何操作
         */
        let pp = lodash.split(para_string, ".", 2);
        let point_name = pp[0];
        let para = pp[1];
        let point = this[point_name];
        if (point) {
            if (!point["href"]) {
                point["href"] = {};
            }
            point["href"][para] = link
        }
    },
    get_para_link(para_string) {
        /**
         * 获取某个参数的位置引用，即href属性，例如 get_para_link("extract_2.P") = "汽机!{Y}23"，，如果变量中的测点名不属于StandardPoint，则返回空
         */
        let pp = lodash.split(para_string, ".", 2);
        let point_name = pp[0];
        let para = pp[1];
        let point = this[point_name];
        if (point) {
            if (point["href"]) {
                return point["href"][para];
            } // 如果href不存在，进一步查找link
        }
    }
};

let StandardPointOrigin = lodash.cloneDeep(StandardPoint);


class Leakage {
    constructor(dataframe, row, col) {
        /**
         * row,col表示漏汽信息在excel表格中的区域左上角坐标，如A1对应的row=1,col=1
         * @type {*}
         */
        this.origin_data = lodash.cloneDeep(dataframe)  // 深拷贝一份，获取参数excel引用位置时使用
        this.to = dataframe.get_column_by_name("to");
        if (this.to === null) {
            alert("sheet 【漏气】中不包括漏气去向列（列名为to），请检查！")
        }
        this.data = dataframe.drop_by_name("to", 1);
        this.condition = this.data.title;
        this.row = row;
        this.col = col;
    }

    get_standard_name(user_name) {
        /**
         * 根据用户输入的变量名获取对应的软件内部定义的标准名称
         */
        // let names = {
        //     高压门杆一漏: {
        //         include: ["高压门杆一漏", "高压门杆漏汽"],
        //         exclude: ["二漏"],
        //     },
        //     高压门杆二漏: {
        //         include: ["高压门杆二漏"],
        //         exclude: [],
        //     }
        // }
        //
        // for (let name of names) {
        //
        // }
        return user_name;
    }

    get_source(component) {
        /**
         * 获取流向compenent的漏汽的来源，例如：get_source("高排") = “高压缸前轴封一漏"，是get_destination()的反操作
         */
        component = this.get_standard_name(component);
        let idx = lodash.indexOf(this.to.toArray(), component)
        let res = this.data.index[idx]
        return res
    }

    get_destination(leakage_name) {
        /**
         * 获取漏气的去向，如get_destination("高压缸前轴封一漏") = "高排"，是get_source()的反操作
         */
        leakage_name = this.get_standard_name(leakage_name)
        return this.to.get_value_by_name(leakage_name)
    }

    get_pos_by_name(para_name, condition_name, used_in) {
        /**
         * 在漏气工作簿中查找指定参数的位置。根据工况名和参数名即可确定位置。如：
         * condition_name = "THA", para_name = "主蒸汽参数"，返回："漏气.C2"等位置引用字符串。
         * condition_name: 可以不指定工况名，则返回所有工况参数的引用区域，如"漏气!C2:D2"，如果指定，则返回单个单元格的引用，如"漏气!C2"
         * used_in：表示求取的位置引用是在那个sheet中使用，如果在漏汽中使用，则不用加sheet名，否则，引用自动带sheet名。
         */
        para_name = this.get_standard_name(para_name); // 将用户自定义的变量名转换为软件内部使用的标准变量名
        let row, col;
        for (let r = 0; r < this.data.index.length; r++) {
            if (this.data.index[r] === para_name) {
                row = r + this.row + 1;
                break;
            }
        }
        if (!row) {
            console.log("查找的变量不存在：" + para_name)
            return null;
        }
        if (condition_name) {
            for (let c in this.origin_data.title) {
                if (this.origin_data.title[c] === condition_name) {
                    col = parseInt(c) + this.col + 1;
                }
            }
            if (!col) {
                console.log("查找的工况不存在")
                return null;
            }
            if (used_in === "漏汽") {
                return Num2ColumnChar(col) + row;
            } else {
                return "漏汽!" + Num2ColumnChar(col) + row;
            }
        } else {
            let start_condition = this.condition[0];
            let end_condition = this.condition[this.condition.length - 1];
            let start_col, end_col;
            for (let c in this.origin_data.title) {
                if (this.origin_data.title[c] === start_condition) {
                    start_col = parseInt(c) + this.col + 1;
                } else if (this.origin_data.title[c] === end_condition) {
                    end_col = parseInt(c) + this.col + 1;
                }
            }
            let start_y = Num2ColumnChar(start_col);
            let end_y = Num2ColumnChar(end_col);
            let pos;
            if (used_in === "漏汽") {
                pos = start_y + row + ":" + end_y + row
            } else {
                pos = "漏汽!" + start_y + row + ":" + end_y + row
            }
            return pos;
        }
    }

    get_工况数量() {
        return this.condition.length
    }

    get_leakage(name, main_steam_pos) {
        /**
         * 根据主汽流量获取指定的漏汽量
         */
        console.log(name);
        console.log(main_steam_pos);
        if (this.get_工况数量() === 1) {
            // 说明只有一个工况的参数
            let main_steam1 = this.get_pos_by_name("主蒸汽流量", this.condition[0])
            let name1 = this.get_pos_by_name(name, this.condition[0]);
            if (name1) {
                let leakage = "=" + main_steam_pos + "/" + main_steam1 + "*" + name1
                if (leakage)
                    return leakage;
            } else {
                return null;
            }
        } else if (this.get_工况数量() > 1) {
            // 根据多个工况进行插值
            let main_steam_section = this.get_pos_by_name("主蒸汽流量")
            let name1 = this.get_pos_by_name(name)
            if (name1) {
                let leakage = "=TREND(" + name1 + "," + main_steam_section + "," + main_steam_pos + ")"
                if (leakage)
                    return leakage
            } else {
                return null;
            }
        }
    }
}

function get_point_by_name(name) {
    /**
     * 根据name属性获取对应的测点对象
     */
    for (let i in StandardPoint) {
        let item = StandardPoint[i];
        if (item["name"] === name) {
            return item;
        }
    }
}

export function make_equal(point1, point2, sp = StandardPoint) {
    /**
     * 对StandardPoint中某两个点进行关联，使其引用和数值相等，例如一号高加出水=二号高加进水，则这两个点则共享P、T、H等热力参数
     * 即使链接了两个点，获取参数href和value时，还是优先使用指定名称的href和value中的值，例如：
     * 链接了给泵出水和三号高加进口，即make_equal("feed_pump_out", "heater_3_water_in")，但当这两个点的值如下时，
     * feed_pump_out: {href: {P: ["数据处理!{Y}1], T: null, F: ["数据处理!{Y}10]}}
     * heater_3_water_in: {href: {P: null, T: ["数据处理!{Y}2], F: ["数据处理!{Y}20]}}
     * 则：
     * get_position_of_para("feed_pump_out.P", "D") 将获取到 "数据处理!D1"
     * get_position_of_para("feed_pump_out.T", "D") 将获取到 "数据处理!D2"
     * get_position_of_para("feed_pump_out.F", "D") 将获取到 "数据处理!D10"
     * get_position_of_para("heater_3_water_in.P", "D") 将获取到 "数据处理!D1"
     * get_position_of_para("heater_3_water_in.T", "D") 将获取到 "数据处理!D2"
     * get_position_of_para("heater_3_water_in.F", "D") 将获取到 "数据处理!D20"
     */
    if (!sp[point1]) {
        alert("点名不存在与enum.StandardPoint中，请检查：" + point1)
        return
    }
    if (!sp[point2]) {
        alert("点名不存在与enum.StandardPoint中，请检查：" + point2)
        return
    }
    if (sp[point1]["link"]) {
        // 如果存在link属性
        if (!lodash.includes(sp[point1]["link"], point2)) {
        }
        // 如果link属性中不包含point2，就添加，包含则不做操作
        sp[point1]["link"].push(point2);
    } else {
        sp[point1]["link"] = [point2];
    }

    if (sp[point2]["link"]) {
        if (!lodash.includes(sp[point2]["link"], point1))
            sp[point2]["link"].push(point1);
    } else {
        sp[point2]["link"] = [point1];
    }
}

export default {
    alternative_symbol,
    pressure_absolute,
    pressure_relative,
    name_alias,
    StandardPoint,
    StandardPointOrigin,
    Leakage,
    get_point_by_name,
};
